﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kovan.DAL
{
    public interface IDAL<T>
    {
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        T GetModel(long id);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        int Add(T model);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        int Delete(long id);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        int Update(T model);
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids">id集合</param>
        /// <returns></returns>
        int BatchDelete(IEnumerable<string> ids);
    }
}
